package com.zengguang.testkaoshi.services.impl;

import com.zengguang.testkaoshi.dao.AnswerDao;
import com.zengguang.testkaoshi.pojo.Answer;
import com.zengguang.testkaoshi.services.IAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AnswerService implements IAnswerService {
    @Autowired
    private AnswerDao answerDao;
    //插入
    @Override
    public int insertAnswer(Answer answer) {
        int returnInt=0;
        int addAnswerInt=answerDao.insertAnswer(answer);
        returnInt=addAnswerInt;
        return returnInt;
    }
    //更新
    @Override
    public int updateAnswer(Answer answer) {
        int returnInt=0;
        int addAnswerInt=answerDao.updateAnswer(answer);
        returnInt=addAnswerInt;
        return returnInt;
    }
    //查询
    @Override
    public List<Answer> selectAllAnswer() {
        List<Answer> list=answerDao.selectAllAnswer();
        return list;
    }
    //删除
    @Override
    public int deleteAnswer(int answerid) {
        int returnInt=0;
        int addAnswerInt=answerDao.deleteAnswer(answerid);
        returnInt=addAnswerInt;
        return returnInt;
    }
}
